<template>
  <div>
    {{ formValidate.fkRuralId }}
    <Form ref="formValidate" :model="formValidate" :label-width="120" :label-colon="true" :rules="formRules"
          style="width: 200px;"
          :disabled="type === 3">
      <FormItem label="农村名称" prop="rfRuralName">
        <Input v-model="formValidate.rfRuralName"/>
      </FormItem>
      <FormItem label="党员活动平均参与率">
        <Input v-model="formValidate.activityRate"/>
      </FormItem>
      <FormItem label="统计年份">
        <DatePicker placeholder="请选择统计年份" type="year" format="yyyy" @on-change="formValidate.statisticsYear = $event"
                    v-model="formValidate.statisticsYear"
                    style="width: 200px"></DatePicker>
      </FormItem>
      <FormItem :label-width="0" style="text-align: right">
        <Button style="margin-right: 10px;" @click="publicReset('formValidate')">取消</Button>
        <Button type="primary" @click="publicSubmit('formValidate')">确定</Button>
      </FormItem>
    </Form>
  </div>
</template>

<script>
import { updateMixin } from '@/mixin/index'
import API_KEY from '../../../api'
import store from '@/store'

export default {
  mixins: [updateMixin],
  data () {
    return {
      formValidate: { // 搜索条件
        fkRuralId: store.getters.userInfo.deptList[0].id,
        rfRuralName: '',
        statisticsYear: '',
        activityRate: ''
      },
      formRules: {
        rfRuralName: [{ required: true, message: '请输入农村名称', trigger: 'blur' }]
      },
      action: {
        readDataById: API_KEY.ruralPartyBranch.curdRural,
        createData: API_KEY.ruralPartyBranch.insert,
        updateData: API_KEY.ruralPartyBranch.update
      }
    }
  }
}
</script>

<style scoped lang="scss">

</style>
